Set $USER variable in integration tests
authorChris Wong <lambda.fairy@gmail.com>
Mon, 27 Apr 2015 07:09:48 +0000 (19:09 +1200)
committerChris Wong <lambda.fairy@gmail.com>
Mon, 27 Apr 2015 07:10:08 +0000 (19:10 +1200)
This variable isn't set on homu, so we need to add it ourselves.

tests/test_cargo_new.rs

index 61c4c6b7cfdcacb1a7e364c2001f01d7de5a65c0..6a7b82c7749fdabbaec02f4f456f3cf2aea3a94d 100644 (file)
@@ -97,7 +97,7 @@ test!(invalid_characters {
 });
 
 test!(rust_prefix_stripped {
-    assert_that(cargo_process("new").arg("rust-foo"),
+    assert_that(cargo_process("new").arg("rust-foo").env("USER", "foo"),
                 execs().with_status(0)
                        .with_stdout("note: package will be named `foo`; use --name to override"));
     let toml = paths::root().join("rust-foo/Cargo.toml");
@@ -107,7 +107,7 @@ test!(rust_prefix_stripped {
 });
 
 test!(bin_disables_stripping {
-    assert_that(cargo_process("new").arg("rust-foo").arg("--bin"),
+    assert_that(cargo_process("new").arg("rust-foo").arg("--bin").env("USER", "foo"),
                 execs().with_status(0));
     let toml = paths::root().join("rust-foo/Cargo.toml");
     let mut contents = String::new();
@@ -116,7 +116,7 @@ test!(bin_disables_stripping {
 });
 
 test!(explicit_name_not_stripped {
-    assert_that(cargo_process("new").arg("foo").arg("--name").arg("rust-bar"),
+    assert_that(cargo_process("new").arg("foo").arg("--name").arg("rust-bar").env("USER", "foo"),
                 execs().with_status(0));
     let toml = paths::root().join("foo/Cargo.toml");
     let mut contents = String::new();